package com.ita.bta.listener;

import java.security.Provider.Service;
import java.util.HashMap;
import java.util.Map;

import javax.servlet.Servlet;
import javax.servlet.ServletContext;
import javax.servlet.ServletContextEvent;
import javax.servlet.ServletContextListener;

import com.ita.tba.dao.DishDao;
import com.ita.tba.dao.impl.DishDaoImpl;
import com.ita.tba.po.Dish;
import com.ita.tba.po.DishCache;
import com.ita.tba.service.Controller;
import com.ita.tba.service.impl.ControllerImpl;

/**
 * Application Lifecycle Listener implementation class GetDishesListener
 *
 */
public class GetDishesListener implements ServletContextListener {
	
    /**
     * Default constructor. 
     */
    public GetDishesListener() {
        // TODO Auto-generated constructor stub
    }

	/**
     * @see ServletContextListener#contextDestroyed(ServletContextEvent)
     */
    public void contextDestroyed(ServletContextEvent arg0)  { 
         // TODO Auto-generated method stub
    }

	/**
     * @see ServletContextListener#contextInitialized(ServletContextEvent)
     */
    public void contextInitialized(ServletContextEvent arg0)  { 
    	 Map<Integer, Dish> dishCache = DishCache.getDishes(); 	
//    	 ServletContext application = arg0.getServletContext();
//    	 application.setAttribute("dishCache", dishCache);
//    	 
//    	 
//    	 Service(cart,request)              request.getServletContext().getattribute
    }
	
}
